//
//  Objects.cpp
//  boxer
//
//  Created by Wu Wang on 11-12-21.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#include "Objects.h"

#include <sys/time.h>

long CGameTimer::m_interval = 0;

bool CGameTimer::IsPrepared()
{
    timeval time;
	gettimeofday(&time	, NULL);
	static long lastTime = time.tv_sec * 1000 + time.tv_usec / 1000;
	long curTime = time.tv_sec * 1000 + time.tv_usec / 1000;
	if(curTime - lastTime > m_interval)
    {
        lastTime = curTime;
        return true;
    }
    
    return false;
}
